package com.kantboot.user.third.party.domain.repository;

import com.kantboot.user.third.party.domain.dto.ThirdPartyDTO;
import com.kantboot.user.third.party.domain.entity.UserAccountThirdParty;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

public interface UserAccountThirdPartyRepository
        extends JpaRepository<UserAccountThirdParty,Long> {

    /**
     * 根据ThirdPartyDTO查询
     */
    @Query("""
            FROM UserAccountThirdParty u
            WHERE u.thirdPartyCode = :#{#param.thirdPartyCode}
            AND u.key = :#{#param.key}
            AND u.value = :#{#param.value}
            """
    )
    UserAccountThirdParty find(@Param("param") ThirdPartyDTO param);

}
